package com.iqiyi.pps.epg.api;

import com.iqiyi.kiwi.utils.Configuration;
import com.iqiyi.mams.hedvig.rpc.core.ServiceConfig;
import com.iqiyi.mams.hedvig.rpc.core.ServiceSchema;
import com.iqiyi.mams.hedvig.rpc.core.ServiceType;
import com.iqiyi.mams.hedvig.rpc.server.HedwigServer;
import com.iqiyi.pps.epg.api.server.iservice.ApiService;
import com.iqiyi.pps.epg.api.server.impl.ApiServiceImpl;

public class Server {

    public static void main(String ... args){

        //初始化Configuration
        Configuration.getConfiguration().initConfig("configuration.xml");


        HedwigServer server = HedwigServer.getServer();
        ServiceConfig http = ServiceConfig.newBuilder()
                .type(ServiceType.THRIFT)
                .schema(ServiceSchema.HTTP)
                .serviceFace(ApiService.class)
                .serviceImpl(ApiServiceImpl.class)
                .port(8500)
                .build();
        server.registerService(http);

        server.start();

        System.out.println("HedwigServer start success!");
    }
}
